package pl.polidea.view;

import android.view.View;

/**
 * Adapter for pages with specified size.
 * 
 * @author karooolek
 * 
 */
public abstract class AbstractPagesAdapter {

    /**
     * Get total pages count. Normally it should equal maximumPosition -
     * minimumPosition + 1. This value SHOULD NOT be used for checking position
     * limits (use minimum and maximum instead).
     * 
     * @return total pages count.
     */
    public abstract int getCount();

    /**
     * Get page minimum position.
     * 
     * @return page minimum position.
     */
    public abstract int getMinimumPosition();

    /**
     * Get page maximum position.
     * 
     * @return page maximum position.
     */
    public abstract int getMaximumPosition();

    /**
     * Get object associated with specified page.
     * 
     * @param position
     *            page position.
     * @return object associated with specified page.
     */
    public abstract Object getItem(final int position);

    /**
     * Get view associated with specified page.
     * 
     * @param position
     *            page position.
     * @return view associated with specified page.
     */
    public abstract View getView(final int position);

    /**
     * Get specified page width or -1 to auto-adjust page width.
     * 
     * @param position
     *            page position.
     * @return page width.
     */
    public abstract int getPageWidth(int position);

    /**
     * Get specified page height or -1 to auto-adjust page height.
     * 
     * @param position
     *            page position.
     * @return page height.
     */
    public abstract int getPageHeight(int position);
}
